﻿
/*--------------------------------------------------|
|   名称: Page                                                          |
|---------------------------------------------------|
|   作者: 葛 伟                                                          |
|   版本:1.1alphal                                                     |
|   更新: 2011.05.26                                                |
|---------------------------------------------------*/


//Page类；
var Page = { version: "1.1alphal" };

//集合类;
Page.Collection = {
    Dictionary: function (source, separator) {
        if (!separator) separator = "&";
        var array = source.split(separator);
        var temp = [];
        for (var property in array) {
            temp = array[property].split('=');
            this[temp[0]] = temp[1];
        }
    }
};

//StringBuilder类
Page.StringBuilder = function (string) {
    this.container = [string || ''];
}

//用于调试的Debug类
Page.Debug = {
    MODEL: { P: "P", M: "M" },
    format: function (obj, model, separator) {
        if (!separator) separator = "\n";
        switch (model) {
            case this.MODEL.M:
                {
                    return this.methodToString.call(obj, separator);
                }
            default:
                {
                    return this.propertyToString.call(obj, separator);
                }
        }
    },

    //格式化字符串;
    propertyToString: function (separator) {
        var stringBuilder = new Page.StringBuilder();
        for (var property in this) {
            if (typeof this[property] == "function")
                continue;
            stringBuilder.append(property, "=");
            stringBuilder.append(this[property] + "");
            stringBuilder.append(separator);
        }
        return stringBuilder;
    },

    //格式化方法;
    methodToString: function (separator) {
        var stringBuilder = new Page.StringBuilder();
        for (var property in this) {
            if (typeof this[property] != "function")
                continue;
            stringBuilder.append(property, "=");
            stringBuilder.append(this[property].toString());
            stringBuilder.append(separator);
        }
        return stringBuilder;
    }
};

//通用工具类模块(Page的静态方法)；
Page.tool = {

    //为对象添加属性
    addProperty: function (Obj, propertyName, defaultValue, readonly) {
        Obj["get" + propertyName] = function () {
            return defaultValue;
        }
        if (!readonly) {
            Obj["set" + propertyName] = function (value) {
                defaultValue = value;
            }
        }
    },

    /**
    *扩展一个对象,
    *from:从from对象进行扩展源),
    *to:要扩展的对象（目标）；
    **/
    extension: function (from, to, isAll) {
        if (!isAll) {
            for (var property in from) {
                if (!(property in to))
                    to[property] = from[property];
            }
        }
        else {
            for (var property in from) {
                to[property] = from[property];
            }
        }
    },

    //完成Dom相关操作
    Dom: {

        //移动一个元素
        move: function (event) {
            var element = this;

            //坐标差
            var deltaX = event.clientX - element.offsetLeft;
            var deltaY = event.clientY - element.offsetTop;

            if (document.addEventListener) {
                Page.event.Handler.add(document, Page.eventType.mousemove, moveHandler, true);
                Page.event.Handler.add(document, Page.eventType.mouseup, upHandler, true);
            }
            else if (document.attachEvent) {
                element.setCapture();
                Page.event.Handler.add(element, Page.eventType.mousemove, moveHandler);
                Page.event.Handler.add(element, Page.eventType.mouseup, upHandler);
                Page.event.Handler.add(element, "onlosecapture", upHandler);
            }
            else {
                // IE 4 事件模型
            }

            //阻止事件进一步传播
            event.stopPropagation();

            //阻止默认的动作
            event.preventDefault();

            function moveHandler(e) {
                element.style.left = (e.clientX - deltaX) + "px";
                element.style.top = (e.clientY - deltaY) + "px";

                //阻止事件进一步传播
                e.stopPropagation();
            }

            function upHandler(e) {
                if (document.removeEventListener) {
                    Page.event.Handler.remove(document, Page.eventType.mouseup, upHandler, true);
                    Page.event.Handler.remove(document, Page.eventType.mousemove, moveHandler, true);
                }
                else if (document.detachEvent) {
                    Page.event.Handler.remove(element, "onlosecapture", upHandler);
                    Page.event.Handler.remove(element, Page.eventType.mouseup, upHandler);
                    Page.event.Handler.remove(element, Page.eventType.mousemove, moveHandler);
                    element.releaseCapture();
                }
                else {
                    // IE 4 事件模型
                }
                e.stopPropagation();
            }
        },

        //元素拖动的快捷方式(0级别Dom的注册方式)
        drag: function (element, event) {
            Page.tool.Dom.move.call(element, new Page.event.e(event, element));
        },

        //判断一个元素是否包含另外一个元素;
        IsContains: function (node) {
            do {
                node = node.parentNode;
                if (this == node) {
                    return true;
                }
            } while (node.tagName != 'HTML');
            return false;
        },

        $C: function () {
            var temp = document.createElement(arguments[0]);
            if (temp)
                this.GenerateMethod.apply(temp);
            return temp;
        },

        //选取元素引擎;
        $: function () {
            return this.Decision.apply(this, arguments);
        },

        //决策中心;
        Decision: function () {
            var TempElement = null;
            var temp = null;
            if (arguments.length > 1) {
                TempElement = [];
                for (var i = 0; i < arguments.length; i++) {
                    TempElement.push(this.Handle(arguments[i]));
                }
            }
            else {
                TempElement = this.Handle(arguments[0]);
            }
            return TempElement;
        },

        //处理中心
        Handle: function () {
            var temp = null;
            for (var handler in this.TreatmentPlant) {
                temp = this.TreatmentPlant[handler](arguments[0]);
                if (temp) {
                    if (temp.length) {
                        for (var j = 0; j < temp.length; j++) {
                            this.GenerateMethod.apply(temp[j]);
                        }
                    }
                    else {
                        this.GenerateMethod.apply(temp);
                    }
                    return temp;
                }
            }
            return temp;
        },

        //处理加工工厂;
        TreatmentPlant: [function () {
            if (arguments[0].charAt(0) != "#" &&
            arguments[0].charAt(arguments[0].length - 1) != "#") {
                return document.getElementById(arguments[0]);
            }
            return false;
        }, function () {
            if (arguments[0].charAt(0) == "#") {
                arguments[0] = arguments[0].substr(1);
                return document.getElementsByName(arguments[0]);
            }
            return false;
        }, function () {
            if (arguments[0].charAt(arguments[0].length - 1) == "#") {
                arguments[0] = arguments[0].substr(0, arguments[0].length - 1)
                return document.getElementsByTagName(arguments[0]);
            }
            return false;
        } ],

        //添加显示隐藏的方法
        GenerateMethod: function () {
            this.hide = function () { this.style.display = "none"; };
            this.show = function () { this.style.display = "block"; };
        }
    }
};

//浏览器操作功能模块；
Page.browser = new function () {
    this.url = { reload: function (isFromServer) { window.location.reload(isFromServer) } };

    //获取url参数信息；
    (function (search) {
        if (search) {
            Page.Collection.Dictionary.call(this, search.substr(search.indexOf("?") + 1));
        }
    }).apply(this.url, [window.location.search]);

    //扩展url对象；
    Page.tool.extension(window.location, this.url);

    //浏览器事件名称；
    this.eventType = new function () {
        this.onload = 'load'; this.load = this.onload;
        this.mousemove = 'mousemove'; this.mouseover = 'mouseover';
        this.mouseout = 'mouseout'; this.mouseup = 'mouseup';
        this.mousedown = 'mousedown'; this.click = 'click';
        this.dblclick = 'dblclick'; this.mousewheel = 'DOMMouseScroll';
        this.keydown = 'keydown'; this.keypress = 'keypress';
        this.keyup = 'keyup'; this.focusin = 'focusin';
        this.contextmenu = 'contextmenu'; this.resize = 'resize';
        this.scroll = 'scroll'; this.unload = 'unload';
        this.abort = "abort"; this.blur = "blur";
        this.change = "change"; this.error = "error";
        this.focus = "focus"; this.reset = "reset";
        this.select = "select"; this.submit = "submit";
        this.DOMActivate = "DOMActivate"; this.DOMFocusIn = "DOMFocusIn";
        this.DOMFocusOut = "DOMFocusOut";
    };
    this.geometry = {};

    //初始化窗体的集合信息
    Page.tool.extension(new function () {

        //浏览器窗口可视区域的宽度；
        this.getViewportWidth = function () {
            return window.innerWidth || document.documentElement.clientWidth ||
            document.body.clientWidth;
        };

        //浏览器窗口可视区域的高度；
        this.getViewportHeight = function () {
            return window.innerHeight || document.documentElement.clientHeight ||
            document.body.clientHeight;
        };

        //向右滚动的宽度
        this.getHorizontalScroll = function () {
            return window.pageXOffset || document.documentElement.scrollLeft ||
            document.body.scrollLeft;
        };

        //向上滚动的高度；
        this.getVerticalScroll = function () {
            return window.pageYOffset || document.documentElement.scrollTop ||
            document.body.scrollTop;
        };

        //获取整个文档的实际的宽度；
        this.getDocumentWidth = function () {
            if (document.documentElement && document.documentElement.scrollWidth
            && document.body.scrollWidth) {
                return Math.max(document.body.scrollWidth, document.documentElement.scrollWidth);
            }
            else {
                return document.body.scrollWidth || document.documentElement.scrollWidth;
            }
        };

        //获得整个文档的实际高度
        this.getDocumentHeight = function () {
            if (document.documentElement && document.documentElement.scrollHeight
            && document.body.scrollHeight) {
                return Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
            }
            else {
                return document.documentElement.scrollHeight || document.body.scrollHeight;
            }
        };
    }, this.geometry);
};


/**
*Page事件注册模块
**/
Page.event = {

    //事件函数处理容器
    HandlerContainer: {},

    //处理程序记录类
    HandlerRecord: function (element, eventType, handler, wrappedFunction) {
        this.element = element;
        this.eventType = eventType;
        this.handler = handler;

        //外围函数
        this.wrappedHandler = wrappedFunction;
    },

    //为IE封装的事件对象
    e: function (event, element) {
        this._e = event;
        this.type = event.type;
        this.target = event.srcElement;
        this.currentTarget = element;
        this.relatedTarget = event.fromElement ? event.fromElement : event.toElement;
        this.eventPhase = (event.srcElement === element) ? 2 : 3;

        // 鼠标坐标;
        this.clientX = event.clientX;
        this.clientY = event.clientY;
        this.screenX = event.screenX;
        this.screenY = event.screenY;

        //键盘状态
        this.altKey = event.altKey;
        this.ctrlKey = event.ctrlKey;
        this.shiftKey = event.shiftKey;
        this.charCode = event.keyCode;

        //事件管理方法;
        this.stopPropagation = function () { this._e.cancelBubble = true; };
        this.preventDefault = function () { this._e.returnValue = false; };
    },
    Handler: {

        //事件处理函数的查找（防止同一个函数注册两次或者删除一个不存在的注册函数）
        find: function (element, eventType, handler) {
            if (!element.handlers) return -1;
            for (var i = element.handlers.length - 1; i >= 0; i--) {
                if (Page.event.HandlerContainer[element.handlers[i]].eventType === eventType
                        && Page.event.HandlerContainer[element.handlers[i]].handler === handler) {
                    return i;
                }
            }
            return -1;
        },
        removeAllHandlers: function () {
            var temp = null;
            for (var i in Page.event.HandlerContainer) {
                temp = Page.event.HandlerContainer[i];
                temp.element.detachEvent(temp.eventType, temp.wrappedHandler);
                delete Page.event.HandlerContainer[i];
            }
        }
    }
};

//初始化事件处理模块;
(function () {
    if (document.addEventListener) {
        Page.event.Handler.add = function (element, eventType, handler, Bubble) {
            element.addEventListener(eventType, handler, Bubble);
        };
        Page.event.Handler.remove = function (element, eventType, handler, Bubble) {
            element.removeEventListener(eventType, handler, Bubble);
        };
    }
    else if (document.attachEvent) {
        Page.event.Handler.add = function (element, eventType, handler) {
            eventType = "on" + eventType;

            //检查此类型的事件是否多次注册过同一个函数;
            if (Page.event.Handler.find(element, eventType, handler) != -1) return;

            //一个全局的事件处理函数存储区;存储所有的事件注册记录;
            Page.event.HandlerContainer["handler" + Page.unique()] = new Page.event.HandlerRecord(element, eventType, handler,
                              function (e) {
                                  if (!e) e = window.event;
                                  if (Function.prototype.call) {
                                      handler.call(element, new Page.event.e(e, element));
                                  }
                                  else {
                                      element._currentHandler = handler;
                                      element._currentHandler(new Page.event.e(e, element));
                                      element._currentHandler = null;
                                  }
                              });

            //元素对象记录自己的注册记录ID
            if (!element.handlers) element.handlers = [];
            element.handlers.push("handler" + (Page.unique() - 1));

            //将外围函数注册为事件处理函数;
            element.attachEvent(eventType, Page.event.HandlerContainer["handler" + (Page.unique() - 2)].wrappedHandler);

            //在窗口卸载时是否要移除全部注册的事件(在IE里防止内存泄露)
            if (!Page.event.WindowUnloadHandlerRegistered) {
                Page.event.WindowUnloadHandlerRegistered = true;
                window.attachEvent("onunload", Page.event.Handler.removeAllHandlers);
            }
        };

        //删除事件的注册
        Page.event.Handler.remove = function (element, eventType, handler) {
            eventType = "on" + eventType;
            var index = Page.event.Handler.find(element, eventType, handler);
            if (index == -1) return;
            element.detachEvent(eventType, Page.event.HandlerContainer[element.handlers[index]].wrappedHandler);
            delete Page.event.HandlerContainer[element.handlers[index]];
            element.handlers.splice(index, 1);
        };
    }
})();

/**
*控件相关类；
*该类是页面的特效类，以后会慢慢的写出各种特效；
**/
Page.Control = {

    //模式（枚举），默认，框架，内联
    MODEL: { DEFAULT: 0, FRAME: 1, INLINE: 2 },

    //弹出窗口；
    Pop: function (isListen, pattern, hasBackground, content) {
        this.listen = isListen;
        this.pattern = pattern;
        this.hasBackground = hasBackground;
        this.content = content;
        this.scene = {};
        this.entity = Page.tool.Dom.$C("div");
        this.entity.hide();
        this.style = this.entity.style;
        this.style.position = 'absolute';
        this.style.width = "300px";
        this.style.height = "200px";
        this.style.zIndex = Page.unique();
        this.style.backgroundColor = "#CCCCCC";
        var temp = this;
        this.listenerHandler = function () { temp.draw(); };
    }
};

/**
*Ajax组件；
*目前仅仅支持异步请求，同步请求正在慢慢解决；
**/
Page.Ajax = function () {
    if (window.XMLHttpRequest)
        this.XMLHttpRequestObject = new XMLHttpRequest();
    else if (window.ActiveXObject)
        this.XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");

    //get回文本；
    this.getDataReturnText = function (url, callback, asyn) {
        var temp = this.XMLHttpRequestObject;
        if (this.XMLHttpRequestObject) {
            this.XMLHttpRequestObject.open("GET", url, asyn);
        }
        this.XMLHttpRequestObject.onreadystatechange = function () {
            if (temp.readyState == 4 && temp.status == 200) {
                callback(temp.responseText);
            }
        }
        this.XMLHttpRequestObject.send(null);
    };

    //get回xml；
    this.getDataReturnXML = function (url, callback) {
        if (this.XMLHttpRequestObject) {
            this.XMLHttpRequestObject.open("GET", url);
        }
        this.XMLHttpRequestObject.onreadystatechange = function () {
            if (this.readyState == 4 && this.status == 200) {
                callback(this.responseXML);
            }
        };
        this.XMLHttpRequestObject.send(null);
    };

    //post回文本；
    this.postDataReturnText = function (url, data, callback) {
        var temp = this.XMLHttpRequestObject;
        if (this.XMLHttpRequestObject) {
            this.XMLHttpRequestObject.open("POST", url);
            this.XMLHttpRequestObject.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        }
        this.XMLHttpRequestObject.onreadystatechange = function () {
            if (temp.readyState == 4 && temp.status == 200) {
                callback(temp.responseText);
            }
        };
        this.XMLHttpRequestObject.send(data);
    };

    //post回xml
    this.postDataReturnXML = function (url, data, callback) {
        if (this.XMLHttpRequestObject) {
            this.XMLHttpRequestObject.open("POST", url);
            this.XMLHttpRequestObject.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        }
        this.XMLHttpRequestObject.onreadystatechange = function () {
            if (this.readyState == 4 && this.status == 200) {
                callback(this.responseXML);
            }
        };
        this.XMLHttpRequestObject.send(data);
    }
};

//Cookie操作
Page.Cookie = function (name, value) {
    this.name = name;
    if (!value) {
        var cookie = document.cookie;
        var position = cookie.indexOf(name);
        if (position >= 0) {
            var sign = cookie.indexOf(";", position + name.length);
            if (sign < 0) {
                this.value = decodeURIComponent(cookie.substring(position + name.length + 1));
            }
            else {
                this.value = decodeURIComponent(cookie.substring(position + name.length + 1, sign));
            }
        }
        else {
            this.value = "";
        }
    }
    else {
        this.value = value;
    }
};

//立即丢弃Cookie
Page.Cookie.prototype.discard = function () {
    var time = new Date();
    time.setTime(time.getTime()-100000);
    this.expires = time.toUTCString();
    this.store();
};

//存储Cookie
Page.Cookie.prototype.store = function () {
    var cookie = new Page.StringBuilder(this.name);
    cookie.append('=', encodeURIComponent(this.value));
    if (this.expires)
        cookie.append(';expires=', this.expires);
    if (this.path) {
        cookie.append(';path=', this.path);
    }
    if (this.domain) {
        cookie.append(';domain=', this.domain);
    }
    document.cookie = cookie;
};

/**
*Page 内部对象原型的扩展
**/
//StringBuilder类的添加方法
Page.StringBuilder.prototype.append = function () {
    for (var i = 0; i < arguments.length; i++)
        this.container.push(arguments[i] || "");
};

//StringBuilder类重载了toString方法
Page.StringBuilder.prototype.toString = function () {
    return this.container.join("");
};

//去除左空格
String.prototype.ltrim = function () {
    var whitespace = new String(" \t\n\r");
    var temp = new String(this);
    if (whitespace.indexOf(temp.charAt(0)) != -1) {
        var j = 0, i = temp.length;
        while (j < i && whitespace.indexOf(temp.charAt(j)) != -1) {
            j++;
        }
        temp = temp.substring(j, i);
    }
    return temp;
};

//去除右边空格
String.prototype.rtrim = function () {
    var whitespace = new String(" \t\n\r");
    var temp = new String(this);
    if (whitespace.indexOf(temp.charAt(temp.length - 1)) != -1) {
        var i = temp.length - 1;
        while (i >= 0 && whitespace.indexOf(temp.charAt(i)) != -1) {
            i--;
        }
        temp = temp.substring(0, i + 1);
    }
    return temp;
};

//去除两边空格
String.prototype.trim = function () {
    var temp = new String(this);
    temp = temp.ltrim().rtrim();
    return temp.toString();
};

//字符串中汉字的统计
String.prototype.chCount = function () {
    var count = 0;
    for (var i = 0; i < this.length; i++)
        if (this.charCodeAt(i) >= 19968 && this.charCodeAt(i) <= 40869)
            count++;
    return count;
}

/**
*Control内部属性原型的扩展；
**/
//Pop对象原型扩展
Page.Control.Pop.prototype.Initialization = function () {
    this.listen = typeof this.listen != "boolean" ? true : this.listen;
    this.pattern = typeof this.pattern != "number" ? Page.Control.MODEL.DEFAULT :
    this.pattern > Page.Control.MODEL.INLINE || this.pattern < Page.Control.MODEL.DEFAULT ?
Page.Control.MODEL.DEFAULT : this.pattern;
    this.hasBackground = typeof this.hasBackground != 'boolean' ? true : this.hasBackground;
    if (this.hasBackground) {
        this.InitBackground();
        document.body.appendChild(this.backdrop);
    }
    this.TreatmentPlant[this.pattern].apply(this);
    document.body.appendChild(this.entity);
    this.draw();
    if (this.listen) {
        Page.attachEventListener(window, Page.eventType.resize, this.listenerHandler);
        Page.attachEventListener(window, Page.eventType.scroll, this.listenerHandler);
    }
};

//背景初始化
Page.Control.Pop.prototype.InitBackground = function () {
    this.backdrop = Page.tool.Dom.$C("div");
    this.backdrop.hide();
    this.backdrop.style.backgroundColor = 'black';
    this.backdrop.style.position = 'absolute';
    this.backdrop.style.MozOpacity = '.50';
    this.backdrop.style.filter = 'alpha(opacity=50)';
    this.backdrop.style.opacity = '.50';
    this.backdrop.style.left = '0px';
    this.backdrop.style.zIndex = Page.unique() - 2;
    this.backdrop.style.top = '0px';
};

//显示对话框;
Page.Control.Pop.prototype.show = function () {
    this.Initialization();
    if (this.hasBackground) {
        this.backdrop.show();
    }
    this.entity.show();
    Page.tool.extension(this, this.scene, true);
};

//展现背景和弹出框;
Page.Control.Pop.prototype.draw = function () {
    if (this.hasBackground) {
        this.backdrop.style.height = Page.browser.geometry.getDocumentHeight() + "px";
        this.backdrop.style.width = Page.browser.geometry.getDocumentWidth() + "px";
    }
    this.entity.style.top = (parseInt(Page.browser.geometry.getVerticalScroll())
+ ((Page.browser.geometry.getViewportHeight() - parseInt(this.style.height)) / 2)) + "px";
    this.entity.style.left = (parseInt(Page.browser.geometry.getHorizontalScroll())
+ ((Page.browser.geometry.getViewportWidth() - parseInt(this.style.width)) / 2)) + "px";
};

//关闭弹出框；
Page.Control.Pop.prototype.close = function () {
    this.entity.hide();
    if (this.hasBackground) {
        this.backdrop.hide();
    }
    this.revert[this.scene.pattern].apply(this.scene);
    Page.tool.extension(this.scene, this, true);
    if (this.listen) {
        Page.detachEventListener(window, Page.eventType.resize, this.listenerHandler);
        Page.detachEventListener(window, Page.eventType.scroll, this.listenerHandler);
    }
    document.body.removeChild(this.entity);
    if (this.hasBackground) {
        document.body.removeChild(this.backdrop);
    }
};

//现场还原;
Page.Control.Pop.prototype.revert = [
function () {
    this.content = this.entity.innerHTML;
    this.entity.innerHTML = '';
},
function () {
    var temp = this.content.src;
    this.entity.removeChild(this.content);
    this.content = temp;
},
function () {
    if (this.content) {
        this.content.hide();
        this.content = (document.body.appendChild(this.content)).id;
    }
}
];

//弹出框处理工厂(目前支持三种模式)
Page.Control.Pop.prototype.TreatmentPlant = [
function () {
    this.entity.innerHTML = typeof this.content != 'string' ? '' : this.content;
},
function () {
    var temp = this.content;
    this.content = Page.tool.Dom.$C("iframe");
    this.content.src = typeof temp != 'string' ? '#' : temp;
    this.content.scrolling = "no";
    this.entity.appendChild(this.content);
},
function () {
    if (typeof this.content == 'string') {
        this.content = this.entity.appendChild(Page.tool.Dom.$(this.content));
        this.content.show();
    }
}
];

/*--------------------------------------------------|
|                            Page初始化引擎                         |
|---------------------------------------------------*/
(function () {

    /**
    *Page空间相关，有底层对象提供一些便捷的访问方式;
    **/
    var autoID = 100000;

    //产生自动增长的只读数字;
    Page.unique = function (step) { return autoID += step ? step : 1; };

    //绑定事件监听方法
    Page.attachEventListener = Page.event.Handler.add;

    //删除事件监听方法
    Page.detachEventListener = Page.event.Handler.remove;

    //事件类型属性;
    Page.eventType = Page.browser.eventType;

    /**
    *浏览对象相关（browser）;
    **/
    Page.browser.version = new function (uA) {
        if (uA.indexOf('Netscape') != -1) {
            this.B = 'Netscape';
            this.V = parseFloat(uA.substring(uA.indexOf('Netscape') + 9, uA.length));
        }
        else if (uA.indexOf('Opera') != -1) {
            this.B = 'Opera';
            this.V = parseFloat(uA.substring(uA.indexOf('Opera') + 6, uA.length));
        }
        else if (uA.indexOf('Firefox') != -1) {
            this.B = 'Firefox';
            this.V = parseFloat(uA.substring(uA.indexOf('Firefox') + 8, uA.length));
        }
        else if (uA.indexOf('MSIE') != -1) {
            this.B = 'IE';
            this.V = parseFloat(uA.substring(uA.indexOf('MSIE') + 4, uA.length));
        }
        else if (uA.indexOf('Chrome') != -1) {
            this.B = 'Chrome';
            this.V = parseFloat(uA.substring(uA.indexOf('Chrome') + 7, uA.length));
        }
        else {
            this.B = 'UN';
            this.V = -1;
        }
    } (window.navigator.userAgent);

    //弹出框模式（枚举），默认，框架，内联
    Page.Control.Pop.MODEL = { DEFAULT: 0, FRAME: 1, INLINE: 2 };
})();